﻿@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
    Layout = "umbLayout.cshtml";

    var pageTitle = string.IsNullOrWhiteSpace(CurrentPage.Title)
        ? CurrentPage.Name
        : CurrentPage.Title;


    var menuItems = CurrentPage.Menu;
    var menuContainers = CurrentPage.MenusContainer;
}
<!-- Main -->
<div id="main-wrapper">
    <div id="main" class="container">
        <div class="row">
            <div class="12u skel-cell-mainContent">
                <div class="title-background" style="margin-bottom:50px; margin-top:30px">
                    <h2>@pageTitle</h2>
                </div>
                
                <div class="content">
                        <span class="wrapper-top-left"></span><span class="wrapper-top" ></span><span class="wrapper-left" ></span><span class="wrapper-bottom-left" ></span><span class="wrapper-bottom" ></span><span class="wrapper-bottom-right" ></span><span class="wrapper-right" ></span><span class="wrapper-top-right" ></span>
                    
                    <!-- Content -->
                    <article class="is-page-content">
                        @{
                            if (menuContainers.Count() != 0) {
                            <h1>Подкатегории</h1>
                            }
                            
                        }
                        <div>
                            @foreach (var item in menuContainers)
                            {
                                var title = string.IsNullOrWhiteSpace(item.Title) 
                                    ? item.Name 
                                    : item.Title;
                                <div class="menu-item-container title-background">
                                    <h3><a href="@item.Url">@title</a></h3>
                                    
                                    @if (string.IsNullOrWhiteSpace(item.Image) == false)
                                    {
                                        <a href="@item.Url" class="image news-image"><img src="@item.Image" alt="" /></a>
                                    }
                                </div>
                            }
                         </div>
                        
                        <h1>Доступные меню</h1>
                        <div>
                            @foreach (var item in menuItems)
                            {
                                var title = string.IsNullOrWhiteSpace(item.Title) 
                                    ? item.Name 
                                    : item.Title;
                                <div class="menu-item-container title-background">
                                    <h3><a href="@item.Url">@title</a></h3>
                                    
                                    @if (string.IsNullOrWhiteSpace(item.Image) == false)
                                    {
                                        <a href="@item.Url" class="image news-image"><img src="@item.Image" alt="" /></a>
                                    }
                                </div>
                            }
                         </div>
                    </article>
                      <article class="is-page-content">
                        <section>
                            @if (string.IsNullOrWhiteSpace(CurrentPage.Image) == false)
                            {
                                <span class="image news-image"><img src="@CurrentPage.Image" alt="" /></span>
                            }

                            @CurrentPage.BodyText
                        </section>                           
                    </article>
                    <!-- /Content -->
                </div>
            </div>
        </div>
    </div>
</div>
<!-- /Main -->